package com.googlecode.framework.core.exception.monitor.support;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.googlecode.framework.core.exception.monitor.ExceptionMonitor;
import com.googlecode.framework.core.exception.monitor.ExceptionMonitorEvent;

public class LoggingExceptionMonitor implements ExceptionMonitor {

    private Logger logger = LoggerFactory.getLogger(getClass());
    
    @Override
    public void monitor(ExceptionMonitorEvent event) {
        if (logger.isErrorEnabled()) {
            logger.error(event.getThrowable().getMessage(), event.getThrowable());
        }
    }

}
